Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fixed error in search results due to document title #550

Merged
merged 1 commit into from
Feb 14, 2024

Conversation

aryashah27
Copy link
Contributor

@aryashah27 aryashah27 commented Feb 13, 2024

What do these changes do/fix?

When using search, regardless of user query (empty or with actual strings), the message There was an error rendering SearchResults, when the code doesn't find document title where it is supposed to be. With this fix, it handles the case where title is its own separate field in the document with the format "title": { "a": 1, "text": "title text" }. If the field title is an object and doesn't have a field text in string format, just returns the toString() so that would result in displaying [object Object]. This would prevent the component from crashing.

Github issue: 16447

How do you test/verify these changes?

  1. Download test.json.zip
  2. Unzip the file
  3. Create a collection by uploading test.json
  4. Once the collection is created, go to Improve and Customize
  5. No need to type something in the search bar, just hit enter
  6. You should get the results with the title text as a part of the results

Have you documented your changes (if necessary)?

Are there any breaking changes included in this pull request?

Copy link
Contributor

@noah-eigenfeld noah-eigenfeld left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good, and the fix seems to be working when I test locally

@aryashah27 aryashah27 merged commit 220798d into master Feb 14, 2024
4 checks passed
@aryashah27 aryashah27 deleted the fix/document-title-object branch February 14, 2024 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants